import com.cos.emp.dao.EmpDao;
import com.cos.emp.entity.Emp;
import com.cos.emp.util.MyBatisUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.junit.Test;

import java.util.List;

/**
 * @author: COS
 * @time: 2022/6/1 14:50
 * @description:
 */
public class Demo {
    @Test
    public void t1(){

        EmpDao mapper = MyBatisUtil.getMapper(EmpDao.class);

        PageHelper.startPage(-10,5);
        List<Emp> all = mapper.getAll();
        PageInfo<Emp> pi = new PageInfo<>(all);

        for (Emp emp : pi.getList()) {
            System.out.println(emp);
        }

        System.out.println("=======================");
        System.out.println(pi);

    }


}
